package com.zms.maze;

import java.awt.Point;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;

public class Trap implements Serializable {

	private static final long serialVersionUID = 1L;
	
	public int startx;
	public int starty;
	public Trap(int x,int y) {
		this.startx=x;
		this.starty=y;
	}
	public void writeObject(ObjectOutputStream out) throws IOException {		
		out.writeInt(startx);
		out.writeInt(starty);
	}
	
	public Point getPosition()
	{
		return new Point(startx,starty);
	}
	public static Trap readObject(ObjectInputStream in) throws IOException,ClassNotFoundException {
		return new Trap(in.readInt(),in.readInt());
	}
}
